﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.ComponentModel;
using HotelManagement.DTO;

namespace HotelManagement.DAO
{
    class EquipmentDAO:DataProvider
    {
        public EquipmentDAO()
            :base()
        {

        }

        public bool Insert(EqiupmentDTO equip)
        {
            string strInsert = "insert into equipment(EquipmentName) values(N'" + equip.EquipmentName + "')";
            
            return base._ExecuteQuery(strInsert);
        }
        public bool Update(EqiupmentDTO equip)
        {
            string strUpdate = "update equipment set equipment.EquipmentName = N'" + equip.EquipmentName + "'";
            strUpdate += " where equipment.EquipmentID =" + equip.EquipmentID;

            return base._ExecuteQuery(strUpdate);
        }
        public DataTable Select()
        {
            string strSelect = "select * from equipment";
            return base._Select(strSelect);
        }

    }
}
